<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<link rel="shortcut icon" href="./favicon.ico">
<link rel="icon" href="./favicon.gif" type="image/gif">


<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/assets/css/<?php echo $this->assetsName; ?>.css" /> 
</head>


<body>

<div style="width:600px" class="container member-container">
    
    <div class="col-md-10 member-con mb-alwang-con">

        <?php
        $form = $this->beginWidget('CActiveForm', array(
            'id' => 'ajaxForm',
        ));
        ?>

        <table>
            <tr>
                <td width="80" class="head"><?php echo CHtml::activeLabel($memberAddress, 'consignee'); ?>:</td>
                <td width="500"><?php echo $form->textField($memberAddress, 'consignee'); ?></td>
            </tr>

            <tr>
                <td width="80"  class="head">所在地:</td>
                <td width="500"><?php
                    echo $form->dropDownList(
                            $memberAddress, 'province', CHtml::listData(RegionModel::model()->findAll('region_type=:type', array(':type' => 1)), 'region_id', 'region_name'), array(
                        'empty' => '-请选择-',
                        'ajax' => array(
                            'url' => Yii::app()->createUrl('user/info/getregions'),
                            'data' => array('pid' => 'js:this.value', 'type' => 2),
                            'success' => 'function(html){jQuery("#MembersAddressModel_city").html(html);jQuery("#MembersAddressModel_district").html("<option value=\'0\'>-请选择-</option>")}'
                        )
                            )
                    )
                    ?>

                    <?php
                    echo $form->dropDownList(
                            $memberAddress, 'city', CHtml::listData(RegionModel::model()->findAll('region_type=:type and parent_id=:parent_id', array(':type' => 2,':parent_id'=>$memberAddress->province)), 'region_id', 'region_name'), array(
                        'empty' => '-请选择-',
                        'ajax' => array(
                            'url' => Yii::app()->createUrl('user/info/getregions'),
                            'data' => array('pid' => 'js:this.value', 'type' => 3),
                            'update' => '#MembersAddressModel_district'
                        )
                            )
                    );
                    ?>

                    <?php
                    echo $form->dropDownList(
                            $memberAddress, 'district', CHtml::listData(RegionModel::model()->findAll('region_type=:type and parent_id=:parent_id', array(':type' => 3,':parent_id'=>$memberAddress->city)), 'region_id', 'region_name'), array('empty' => '-请选择-')
                    );
                    ?></td>
                <td><?php echo $form->error($memberAddress, 'address'); ?></td>
            </tr>

            <tr>
                <td width="80"  class="head"><?php echo CHtml::activeLabel($memberAddress, 'address'); ?>：</td>
                <td width="500"><?php echo $form->textField($memberAddress, 'address'); ?></td>
            </tr>
            <tr>
                <td width="80"  class="head"><?php echo CHtml::activeLabel($memberAddress, 'mobile'); ?>：</td>
                <td width="500"><?php echo $form->textField($memberAddress, 'mobile'); ?></td>
            </tr>
            <tr>
                <td width="80"  class="head"><?php echo CHtml::activeLabel($memberAddress, 'zipcode'); ?>：</td>
                <td width="500"><?php echo $form->textField($memberAddress, 'zipcode'); ?></td>
            </tr>

          <?php if(!(!empty($memberInfo->alipay) || !empty($memberInfo->alipay_name))){ ?>
          <tr>
            <td width="80" class="head">支付宝帐号:</td>
            <td width="305"><?php echo $form->textField($memberInfo, 'alipay'); ?><span>返款用到,只能填写一次</span></td>
            <td></td>
          </tr>

          <tr>
            <td class="head">支付宝姓名:</td>
            <td width="400"><?php echo $form->textField($memberInfo, 'alipay_name'); ?><span>返款用到,只能填写一次</span></td>
            <td></td>
          </tr>
          <?php }else{ ?>

          <tr>
            <td class="head">支付宝:</td>
            <td width="400"><span>支付宝账号：<?php echo $memberInfo->alipay; ?> 支付宝姓名：<?php echo $memberInfo->alipay_name; ?></span></td>
            <td></td>
          </tr>

          <?php } ?>

          <tr>
            <td class="head">旺旺:</td>
            <td width="500">
                <?php  
                    if($memberTaobao)
                    {
                        echo "<span>{$memberTaobao->taobao_user_nick}</span>";
                    }else
                    {
                        echo '<input type="text" name="taobao_user_nick"/>  只能填写一次';
                    }
                ?>
            </td>
            <td></td>
          </tr>


            <tr>
                <td width="80"  class="head"></td>
                <td width="500"><?php echo CHtml::submitButton('提交', array('class' => "login-spt btn")); ?></td>
                <td></td>
            </tr>
        </table>
        <?php $this->endWidget(); ?>
    </div>
    <div class="clearfix"></div>
<script src="<?php echo Yii::app()->params->staticUrl; ?>statics/js/ajaxForm.js"></script> 
<link rel="stylesheet" href="<?php echo Yii::app()->params->staticUrl; ?>statics/js/artDialog6/css/ui-dialog.css">
<script src="<?php echo Yii::app()->params->staticUrl; ?>statics/js/artDialog6/js/dialog-min.js"></script> 

<script type="text/javascript">

    $('#ajaxForm').ajaxForm({
        dataType:'json',
        beforeSubmit:function(data, obj, es){
            return true;
        },    //如果OK则return true
        success:function(data){
           
            if(data.status)
            {
                //console.log(top);return;
                window.parent.window.BIAO = true;
                window.parent.window.OBJ.close();
                window.parent.window.BIAO = false;
            }else
            {
                alert(data.info);
            }
        }
    });
</script>

</div>
</body>



</html>